﻿namespace HCore
{
    public abstract class Command
    {
        private int _commandType;
        public int playerId;
        public int networkId;

        public Command(int commandType)
        {
            _commandType = commandType;
        }

        public virtual void Write(OutputMemeryBitStream output)
        {
            output.WriteInt(_commandType);
            output.WriteInt(playerId);
            output.WriteInt(networkId);
        }

        public virtual void Read(InputMemoryBitStream input)
        {
            _commandType = input.ReadInt();
            playerId = input.ReadInt();
            networkId = input.ReadInt();
        }

        public abstract void ProcessCommand(HGame game);
    }
}